<!--
 * @Description: 
 * @Author: jiaxiuc
 * @Date: 2024-04-25
 * @LastEditors: jiaxiuc
 * @LastEditTime: 2024-04-25
-->
<template>
  <el-container class="admin-wrap">
    <el-header class="admin-header">多维表格表单管理系统</el-header>
    <el-container>
      <el-aside width="200px">
        <el-menu :default-active="menuValue" router>
          <el-menu-item index="config">
            <i class="el-icon-setting"></i>
            <span slot="title">多维表格配置</span>
          </el-menu-item>
          <el-menu-item index="users">
            <i class="el-icon-user"></i>
            <span slot="title">人员管理</span>
          </el-menu-item>
        </el-menu>
      </el-aside>
      <el-main class="admin-main">
        <div class="main-wraper">
          <router-view />
        </div>
      </el-main>
    </el-container>
    <el-empty v-if="!permission" :image-size="200" description="暂无权限，请联系管理员开通"></el-empty>
  </el-container>
</template>
<script>
import CONFIG from '@/config/config'
import storage from '@/utils/storage'
export default {
  name: 'Config',
  data() {
    return {
      menuValue: 'config',
      permission: false,
    }
  },
  watch: {
    $route: {
      immediate: true,
      handler(newVal) {
        this.menuValue = newVal.path.split('/').pop()
      },
    },
  },
  created() {
    this.permission = storage.getItem(CONFIG.ADMINPERMISSION) || false
  },
}
</script>
<style scoped lang="less">
@import './admin.less';
</style>
